/**
 * Created by IntelliJ IDEA.
 * User: NadiaPC
 * Date: 23.02.11
 * Time: 21:20
 * To change this template use File | Settings | File Templates.
 */
package controller
{
    import model.LogProxy;

    import org.kolonitsky.alexey.debug.DebugWrapper;
    import org.puremvc.as3.interfaces.INotification;
import org.puremvc.as3.patterns.command.SimpleCommand;

public class RecordAddCommand extends SimpleCommand
{

    override public function execute(notification:INotification):void
    {
        super.execute(notification);
        var type:String = notification.getType() || "";

        DebugWrapper.trace("INFO: CMD > RecordAddCommand");

        var tweetString:String = notification.getBody() as String;

        var logProxy:LogProxy = facade.retrieveProxy(LogProxy.NAME) as LogProxy;
        logProxy.reloadLogOnSuccess = type == "reload";
        logProxy.addRecord(tweetString);
    }
}
}
